<header class="navbar navbar-fixed-top navbar-inverse">
  <div class="container-fluid">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse"
      data-target="#example-navbar-collapse">
        <span class="sr-only">切换导航</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <%= link_to "BNB", root_path, id: "logo" %>
    </div>
    <div class="collapse navbar-collapse" id="example-navbar-collapse">
    <nav>
      <ul class="nav navbar-nav navbar-right">
        <li><%= link_to "Home",    root_path %></li>
        <li><%= link_to "About",    about_path %></li>
        <li><%= link_to "Articles",articles_path %></li>
        <% if logged_in? %>
          <li><%= link_to 'Users', users_path %></li>
          <li><%= link_to 'Write', new_article_path%></li>
          <li class="dropdown">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
              Account <b class="caret"></b>
            </a>
            <ul class="dropdown-menu">
              <li><%= link_to 'Profile', current_user %></li>
              <li><%= link_to 'Setting', edit_user_path(current_user) %></li>
              <li class="'divider"></li>
              <li>
                <%= link_to 'Log out', logout_path, method: :delete %>
              </li>
            </ul>
          </li>
        <% else %>
          <li><%= link_to 'Log in', login_path %></li>
        <% end %>
      </ul>
    </nav>
    </div>
  </div>
</header>